/**
 * 游戏中各个组件坐標列表
 * @author LuoDong
 * @email luo4521@online.net.tw
 * 2010-3-5 9:25
 */
package com.addcn.texas.utils
{
	public class  Coordinate
	{
		private static var _instance : Coordinate;		
		private var _sit_button : Array;
		private var _cards_pos : Array;
		private var _poker_pos : Array;
		private var _banker_pos : Array;
		private var _chip_pos : Array;
		private var _pool_pos : Array;
	
		public function Coordinate() : void
		{				
			if (_instance != null) {
				throw ("[Coordinate] 為單例類!");
			}else {
				_initialize();
			}
		}
		
		public static function getInstance() : Coordinate {
			if ( _instance == null) {				
				_instance = new Coordinate();
			}
			return _instance;
		}
		
		private function _initialize() : void
		{
			//座位按鈕坐標
			_sit_button = [];
			_sit_button[1] = { x:536, y:68 };
			_sit_button[2] = { x:703, y:137 };
			_sit_button[3] = { x:704, y:353 };
			_sit_button[4] = { x:543, y:424 };
			_sit_button[5] = { x:381, y:424 };
			_sit_button[6] = { x:220, y:424 };
			_sit_button[7] = { x:64,  y:364 };
			_sit_button[8] = { x:55 , y:138 };
			_sit_button[9] = { x:229, y:68  };	
			
			//撲克反面牌坐標
			_cards_pos = [];
			_cards_pos[1] = { x:537, y:132 ,r:0};
			_cards_pos[2] = { x:641, y:174 ,r:60};
			_cards_pos[3] = { x:644, y:309 ,r:130};
			_cards_pos[4] = { x:537, y:352 ,r:0};
			_cards_pos[5] = { x:379, y:352 ,r:0};
			_cards_pos[6] = { x:217, y:352 ,r:0};
			_cards_pos[7] = { x:120, y:317,r:60};
			_cards_pos[8] = { x:104, y:179 ,r:130};
			_cards_pos[9] = { x:226, y:132 , r:0 };	
			
			//撲克正面牌坐標
			_poker_pos = [];
			_poker_pos[1] = { x:410, y:26  };
			_poker_pos[2] = { x:590, y:38  };
			_poker_pos[3] = { x:668, y:193 };
			_poker_pos[4] = { x:585, y:408 };
			_poker_pos[5] = { x:416, y:407 };
			_poker_pos[6] = { x:253, y:406 };
			_poker_pos[7] = { x:5,   y:203 };
			_poker_pos[8] = { x:68 , y:33  };
			_poker_pos[9] = { x:264, y:26  };
			
			//莊家圖標坐標
			_banker_pos = [];
			_banker_pos[1] = { x:483, y:136 };
			_banker_pos[2] = { x:601, y:155 };
			_banker_pos[3] = { x:642, y:269 };
			_banker_pos[4] = { x:567, y:325 };
			_banker_pos[5] = { x:411, y:325 };
			_banker_pos[6] = { x:254, y:325 };
			_banker_pos[7] = { x:144, y:319 };
			_banker_pos[8] = { x:111, y:198 };
			_banker_pos[9] = { x:256, y:136 };	
							
			//籌碼坐標			
			_chip_pos = [];
			_chip_pos[1] = { x:536, y:162  };
			_chip_pos[2] = { x:599, y:185 };
			_chip_pos[3] = { x:610, y:278 };
			_chip_pos[4] = { x:539, y:319 };
			_chip_pos[5] = { x:380, y:319 };
			_chip_pos[6] = { x:217, y:319 };
			_chip_pos[7] = { x:143, y:296 };
			_chip_pos[8] = { x:132, y:190 };
			_chip_pos[9] = { x:226, y:162  };
			
			//池底坐標
			_pool_pos = [];
			_pool_pos[1] = { x:135, y:243  };
			_pool_pos[2] = { x:211, y:243 };
			_pool_pos[3] = { x:278, y:243 };
			_pool_pos[4] = { x:349, y:243 };
			_pool_pos[5] = { x:421, y:243 };
			_pool_pos[6] = { x:489, y:243 };
			_pool_pos[7] = { x:561, y:243 };
			_pool_pos[8] = { x:632, y:243 };	
		}
		
		public function SitCoord() : Array
		{
			return _sit_button;			
		}
				
		//獲取反面撲克牌坐標
		public function CardCoord() :  Array
		{
			return _cards_pos;
		}	
		
		public function PokerCoord() : Array
		{
			return _poker_pos;			
		}
		
		public function BankerCoord() : Array
		{
			return _banker_pos;			
		}
		
		public function ChipCoord( ) : Array
		{
			return _chip_pos;			
		}
		
		public function PoolCoord( ) : Array
		{
			return _pool_pos;			
		}	
		
	}
	
}
